package com.sunsharing.common.config;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: criss
 * Date: 13-4-14
 * Time: 上午10:34
 * To change this template use File | Settings | File Templates.
 */
public class RegisterModel {
    public List<NodeModel> nodes = Collections.synchronizedList(new ArrayList<NodeModel>());
    public List<RouterModel> routers = Collections.synchronizedList(new ArrayList<RouterModel>());
    public List<ServiceModel> services = Collections.synchronizedList(new ArrayList<ServiceModel>());

    public NodeModel searchNodeById(String nodeId)
    {
        for(NodeModel n:nodes)
        {
            if(n.nodeId.equalsIgnoreCase(nodeId))
            {
                return n;
            }
        }
        return null;
    }
}
